TEST_FILE = "lyrics.txt"
STANDARD_HEADER = [
    "#TITLE:\n",
    "#ARTIST:\n",
    "#MP3:.mp3\n",
    "#VIDEO:.avi\n",
    "#VIDEOGAP:0\n",
    "#COVER:.jpg\n",
    "#BACKGROUND:.jpg\n",
    "#EDITION:\n",
    "#BPM:\n",
    "#GAP:\n"]
NOTE = 30
LENGTH = 3

input = open(TEST_FILE, "r")
output = open("output.txt", "w")

output.writelines(STANDARD_HEADER)    

counter = 0

for line in input.readlines():
    if line == "\n":
        output.write("- %d\n"%(counter))
        counter += 1
        continue
    if len(line) > 1 and line[-2] == "-":
        output.write(": %d %d %d %s\n"%(counter, LENGTH, NOTE, line[0:-2]))
        counter += LENGTH
        continue
    if line[-1] == "\n":
        output.write(": %d %d %d %s \n"%(counter, LENGTH, NOTE, line[0:-1]))
    else:
        output.write(": %d %d %d %s \n"%(counter, LENGTH, NOTE, line))
    counter += LENGTH
    
output.write("E")    
input.close()
output.close()